package com.whlilong.jxc.app;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbenchPreferenceConstants;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.application.IWorkbenchConfigurer;
import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
import org.eclipse.ui.application.WorkbenchAdvisor;
import org.eclipse.ui.application.WorkbenchWindowAdvisor;

public class ClientWorkbenchAdvisor extends WorkbenchAdvisor {

		private static final String PERSPECTIVE_ID = "com.whlilong.jxc.app.clientperspective";

		public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(
				IWorkbenchWindowConfigurer configurer) {
			return new ClientWorkbenchWindowAdvisor(configurer);
		}

		public void initialize(IWorkbenchConfigurer configurer) {
			super.initialize(configurer);
			configurer.setSaveAndRestore(false);
			PlatformUI.getPreferenceStore().setValue(
					IWorkbenchPreferenceConstants.SHOW_TRADITIONAL_STYLE_TABS,
					false);
			PlatformUI.getPreferenceStore().setValue(IWorkbenchPreferenceConstants.SHOW_INTRO, false);
//			PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_BLACK));

		}

		public String getInitialWindowPerspectiveId() {
			return PERSPECTIVE_ID;
		}
	}

